package com.yehuishou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yehuishou.dao.UserDao;
import com.yehuishou.pojo.Address;
import com.yehuishou.pojo.Erwm;
import com.yehuishou.pojo.Identity;
import com.yehuishou.pojo.User;
import com.yehuishou.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserDao userDao;

	@Override
	public User findLogin(String phone, String password) {
		return userDao.findLogin(phone,password);
	}

	@Override
	public Integer findByPhone(String phone) {
		return userDao.findByPhone(phone);
	}

	@Override
	public Integer add(User user) {
		return userDao.add(user);
	}

	@Override
	public void Update(User user) {
		userDao.Update(user);
	}

	@Override
	public User findById(Integer uid) {
		return userDao.findById(uid);
	}

	@Override
	public void saddress(Address address) {
		userDao.saddress(address);
	}

	@Override
	public Address findAByUid(Integer uid) {
		return userDao.findAByUid(uid);
	}

	@Override
	public void delAddr(Integer uid) {
		userDao.delAddr(uid);
	}

	@Override
	public void updatei(Identity identity) {
		userDao.updatei(identity);
	}

	@Override
	public Identity findIById(Integer uid) {
		return userDao.findIById(uid);
	}

	@Override
	public void updateAddr(Address addr) {
		userDao.updateAddr(addr);
	}

	@Override
	public void saveErwm(Erwm erwm) {
		userDao.delErwm(erwm.getUid());
		userDao.saveErwm(erwm);
	}

	@Override
	public String findErwm(Integer uid) {
		
		return userDao.findErwm(uid);
	}

}
